package cn.jy.erp.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import cn.jy.erp.domain.SalePurchase;
import cn.jy.erp.domain.SjjeTotal;
import cn.jy.erp.domain.WeekConvert;

public interface SalePurchaseMapper {
    int deleteByPrimaryKey(String spid);

    int insert(SalePurchase record);

    int insertSelective(SalePurchase record);

    SalePurchase selectByPrimaryKey(String spid);

    int updateByPrimaryKeySelective(SalePurchase record);

    int updateByPrimaryKey(SalePurchase record);
    /**
     * 根据任务类型查
     * @param rwlx
     * @return
     */
    public List<SalePurchase> getPurchase();
    public List<SalePurchase> getSale();
    
    public List<SalePurchase> getSaleDate();
    
    public void updateByWeek(SalePurchase sPurchase);
    
    public void updateByTotal(SalePurchase sPurchase);
    
    public List<SalePurchase> getByDetailed(@Param("whereWeek")String whereWeek,@Param("rwlx")String rwlx);
    public List<SalePurchase> getBySaleDetailed(@Param("whereWeek")String whereWeek,@Param("rwlx")String rwlx);
    public List<SalePurchase> getBytotal();
	 void insertCGTable(SalePurchase salePurchase);
	 
	 public List<String> getByRwlx(@Param("RWLX")String RWLX);
	 void UpdateRwlx(SalePurchase salePurchase);
	 /**
	  * 根据客户信息任务类型查询获取采购和销售信息绘制图标
	  */
	 public List<SalePurchase> getSaleData(@Param("rwlx")String rwlx,@Param("code")String code);
	 /**
	  * 获取销售或者采购的客户信息
	  */
	 
	 public List<SalePurchase> getBykhxx(@Param("rwlx")String rwlx);
	 /**
	  * 绘制销售采购堆积图
	  * @param rwlx
	  * @return
	  */
	 public List<SalePurchase>getStackingChart(@Param("rwlx")String rwlx);
	 
	 /**
	  * 获取销售采购唯一周和唯一总额度
	  */
	 public List<SalePurchase> getOnlyWeek(@Param("rwlx")String rwlx);
	 
	 /**
	  * 获取唯一客户信息
	  */
	 
	 public List<String> getCustomer(@Param("rwlx") String rwlx);
	 
	 /**
	  * 查询实际付款时间
	  * @return
	  */
	 List<WeekConvert> getDate();
	 
	 /**
	  * 根据查出的付款时间转换成对应周 修改到对应字段
	  */
	 void updateSjWeek(@Param("week")String week,@Param("id")String id);
	 
	 /**
	  * 根据类型查询出实际销售采购总额
	  * @param type
	  * @return
	  */
	 List<SjjeTotal> getSjWeek(@Param("type")String type);
	 
	 void updateSjTotal(@Param("money")String money,@Param("week")String week,@Param("type")String typ);

}